import { http } from '@/utils/http'
import type {
  AgriculturalProducts,
  Banners,
  DailyRecommendations,
  Introductions,
  Notice,
  PageParams,
  PageResult,
  TravelGuides,
} from '@/types/home'
/**
 * 查询轮播图列表
 * @returns any OK
 * @throws ApiError
 */
export const loadBaneerUsingGet = () => {
  return http<Banners[]>({
    url: '/wxapi/loadBaneer',
    method: 'GET',
  })
}

/**
 * 查询介绍列表
 * @returns any OK
 * @throws ApiError
 */
export const loadIntroductionsUsingGet = () => {
  return http<Introductions[]>({
    url: '/wxapi/loadIntroductions',
    method: 'GET',
  })
}
/**
 * 查询介绍详细信息
 * @returns any OK
 * @throws ApiError
 */
export const loadIntroductionsDetailsUsingGet = (id: string) => {
  return http<Introductions>({
    url: `/wxapi/loadIntroductions/${id}`,
    method: 'GET',
  })
}
/**
 * 查询农产品列表
 * @returns any OK
 * @throws ApiError
 */
export const loadAgriculturalProductsUsingGet = (PageParams: PageParams) => {
  return http<PageResult<AgriculturalProducts>>({
    url: `/wxapi/loadAgriculturalProducts?pageNum=${PageParams.pageNum}&pageSize=${PageParams.pageSize}`,
    method: 'GET',
  })
}

/**
 * 获取农产品管理详细信息
 * @param id id
 * @returns any OK
 * @throws ApiError
 */
export const loadAgriculturalProductsUsingDetailGet = (id: string) => {
  return http<AgriculturalProducts>({
    url: `/wxapi/loadAgriculturalProduct/${id}`,
    method: 'GET',
  })
}
/**
 * 查询天气信息
 * @returns any OK
 * @throws ApiError
 */
export const loadWeatherGet = () => {
  return http<any>({
    url: '/wxapi/weather',
    method: 'GET',
  })
}

/**
 * 查询每日推荐列表
 * @returns any OK
 * @throws ApiError
 */
export const loadDailyRecommendationsUsingGet = (PageParams: PageParams) => {
  return http<PageResult<DailyRecommendations>>({
    url: `/wxapi/loadDailyRecommendations?pageNum=${PageParams.pageNum}&pageSize=${PageParams.pageSize}`,
    method: 'GET',
  })
}

/**
 * 查询旅游攻略列表
 * @returns any OK
 * @throws ApiError
 */
export const loadTravelGuidesUsingGet = (PageParams: PageParams) => {
  return http<PageResult<TravelGuides>>({
    url: `/wxapi/loadTravelGuides?pageNum=${PageParams.pageNum}&pageSize=${PageParams.pageSize}`,
    method: 'GET',
  })
}
/**
 * 获取旅游攻略详细信息
 * @param id id
 * @returns any OK
 * @throws ApiError
 */
export const loadTravelGuidesUsingDetailGet = (id: string) => {
  return http<TravelGuides>({
    url: `/wxapi/loadTravelGuides/${id}`,
    method: 'GET',
  })
}
/**
 * 获取通知公告信息
 * @returns any OK
 * @throws ApiError
 */
export const loadNoticeDetailGet = () => {
  return http<Notice[]>({
    url: '/wxapi/loadNotice/',
    method: 'GET',
  })
}
